#include "Drv_E2PROM.h"

#define E2PROM_I2C_ADDR  0xA0 // 
extern I2C_HandleTypeDef hi2c2;

void e2prom_read(uint32_t addr , uint8_t* rbuff, uint32_t len)
{
    printf("read from %ux ,len = %d \n", addr, len);
    HAL_I2C_Mem_Read(&hi2c2, E2PROM_I2C_ADDR, addr, I2C_MEMADD_SIZE_16BIT, rbuff, len, 100);
}

void e2prom_write(uint32_t addr, uint8_t* wbuff, uint32_t len)
{
    printf("write to %ux ,len = %d \n", addr, len);
    HAL_I2C_Mem_Write(&hi2c2, E2PROM_I2C_ADDR, addr, I2C_MEMADD_SIZE_16BIT, wbuff, len, 100);
}
